package com.example.babybus.base

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

// 设置AppCompat Theme 在AndroidManifest.xml
abstract class BaseActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        preInit()
    }

    // 在preInit做ViewBinding
    protected open fun preInit() {}

    protected open fun initData() {}

    protected open fun initListener() {}

    inline fun <reified T : BaseActivity> startActivityAndFinish() {
        startActivity(Intent(this, T::class.java))
        finish()
    }
}